# src/CMakeLists.txt

PROJECT( mv )

SUBDIRS( dense opengl sparse ui )

#SET(CMAKE_CXX_FLAGS "-pg")


#########################
# vxl
#########################
FIND_PACKAGE(VXL)
IF(VXL_FOUND)
  INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)
ELSE(VXL_FOUND)
  MESSAGE("VXL_DIR should be set to the VXL build directory.")
ENDIF(VXL_FOUND)


#########################
# OpenGL
#########################
IF(NOT APPLE)
  MESSAGE("NOT APPLE !!!!")
  FIND_PACKAGE(OpenGL)
ELSE(NOT APPLE)
  MESSAGE("APPLE !!!!")

  FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
    /usr/X11R6/include
  )

  FIND_LIBRARY(OPENGL_gl_LIBRARY
	NAMES GL
	PATHS /usr/X11R6/lib
  )

  FIND_LIBRARY(OPENGL_glu_LIBRARY
	NAMES GLU
	PATHS /usr/X11R6/lib
  )

  SET( OPENGL_LIBRARIES X11 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})

  IF(OPENGL_INCLUDE_DIR AND OPENGL_LIBRARIES)
    SET(OPENGL_FOUND "YES")
  ENDIF(OPENGL_INCLUDE_DIR AND OPENGL_LIBRARIES)

ENDIF(NOT APPLE)

INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})

MESSAGE(${OPENGL_FOUND})
MESSAGE(${OPENGL_INCLUDE_DIR})
